<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>
        <input type="text" oninput="changEvt()">
    </p>
    <p style="height: 16px; background: #f00; color: #fff;" id="info"></p>
    <script>
        var obj = {
            info : 10
        };
        
        Object.defineProperty(obj,'info',{
            enumerable: true,
            set: function(val) {
                document.getElementById('info').innerText = val;
            },
            get: function() {
                var val = document.getElementById('info').innerText
                return val
            }
        })

        function changEvt(e) {
            var tar = window.event.target;
            obj.info = tar.value;
            console.log(obj.info)
        }
    </script>
</body>
</html>